package com.xiaotu.spider.scheduler;

import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Component;
import us.codecraft.webmagic.Request;
import us.codecraft.webmagic.Task;
import us.codecraft.webmagic.scheduler.PriorityScheduler;

@Component("ListScheduler")
@Scope("prototype")
public class ListScheduler extends PriorityScheduler
{
    @Override
    public void push(Request request, Task task)
    {
        logger.trace("get a candidate url {}", request.getUrl());
        pushWhenNoDuplicate(request, task);
        logger.debug("pushed to queue {}", request.getUrl());
    }
}
